home *** CD-ROM | disk | FTP | other *** search
- import java.io.DataInputStream;
- import java.net.MalformedURLException;
- import java.net.URL;
-
- public class CHtmlAction extends CDisplayAction {
- protected String m_strTargetFrame = "";
- protected String m_strURL = "";
- protected URL m_URL;
-
- boolean LoadFromFile(DataInputStream var1) {
- this.m_strURL = FileLoad.ReadCString(var1);
- FileLoad.ReadCPlusInt(var1);
- FileLoad.ReadCString(var1);
- if (Globals.CUR_COURSE.m_nFileVersion > 3) {
- this.m_strTargetFrame = FileLoad.ReadCString(var1);
- }
-
- return super.LoadFromFile(var1);
- }
-
- public CHtmlAction() {
- super(56);
- ((CDisplayAction)this).SetZOrder((short)1);
- }
-
- boolean DoAction() {
- try {
- this.m_URL = new URL(this.m_strURL);
- } catch (MalformedURLException var1) {
- System.out.println("Error: HTML action has a bad URL " + this.m_strURL);
- return false;
- }
-
- if (this.m_URL != null) {
- if (this.m_strTargetFrame != null && this.m_strTargetFrame.length() != 0) {
- Globals.thePresView.getAppletContext().showDocument(this.m_URL, this.m_strTargetFrame);
- } else {
- Globals.thePresView.getAppletContext().showDocument(this.m_URL, "_self");
- }
- }
-
- return true;
- }
- }
-